As network technologies develop, an electronic device held by a user accesses the Internet in various manners, for example, accessing the Internet by using a mobile hotspot created by another electronic device. The device creating the mobile hotspot is a master device, and a device accessing the hotspot is a slave device. The master device enables the mobile hotspot and connects to the Internet, while the slave device accesses the Internet by using the mobile hotspot of the master device as an access point. When the master device connects to the Internet by using a cellular network, the slave device accesses the Internet by using data traffic of the master device. In this case, for the slave device, a type of a network used by the slave device is a wireless local area network type. Generally, in the slave device, an application automatically performs, according to the type of the network used by the slave device, an operation corresponding to the type of the network. For example, the slave device does not restrict use of network traffic in an application on the slave device if the type of the network used by the slave device is a wireless local area network type; for example, an application automatically performs a version update, thereby consuming a relatively large amount of network traffic. Therefore, when a type of a network used by the master device is a cellular network type, because the slave device performs an operation corresponding to the wireless local area network type, a large amount of network traffic is wasted without user's realization.